﻿@model IEnumerable<IceTea.Domain.Models.Release>

@if (Model == null || Model.Count() == 0)
{
   <tr><td colspan="3"> 
       <div class="alert alert-warning">There is no Release of this product, please create one</div>
   </td></tr>
}
else
{
    foreach(IceTea.Domain.Models.Release r in Model){
        <tr>
            <td>@r.Title</td>
            <td>@r.StartDate.ToLongDateString()</td>
            <td>@r.EndDate.ToLongDateString()</td>
            <td>@Ajax.ActionLink(" ", "EditRelease", "Product",
                                    new AjaxOptions()
                                    {
                                        Url = Url.Action("EditRelease", new { releaseId = r.Id }),
                                        UpdateTargetId = "editdialog"
                                    }, new { @class="glyphicon glyphicon-edit", title="Edit"})

                @Ajax.ActionLink(" ", "DeleteRelease", "Product",
                                new AjaxOptions()
                                {
                                    Url = Url.Action("DeleteRelease", new { releaseId = r.Id }),
                                    UpdateTargetId = "editdialog"
                                }, new { @class="glyphicon glyphicon-remove", title="Delete"})                    
            </td>
        </tr>   
    }
}